Skip to content

[AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang: cap running requests, fastokens tokenizer, and DP attention c128/c256 points / [AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang:限制运行请求数、使用 fastokens 分词并新增 DP attention c128/c256 配置点 - #5034

Open
limou102 wants to merge 16 commits into
mainfrom
dev/limou/dsv41flash-mi355x-sglang-c128-c256

Conversation

@limou102

@limou102 limou102 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

In main (#5029), the MI355X SGLang frontier of dsv41flash-fp4-mi355x-sglang-agentic-dspark sags between TP2 c16 and TP2 c4 and between TP2 c4 and TP4 c1, and it stops at 181,052 tok/s/GPU. Most of the sag comes from scheduling. AgentX sessions idle between turns, so a TP2 server at concurrency 4 to 32 decodes about a quarter of its lanes on average, but in bursts of up to half. Where max-running-requests is high, each burst widens the decode step and lowers P90 interactivity.

This PR:

  • Caps running requests at TP2 c8 (16 to 2, prefill-decode-interval 192 to 48), TP2 c64 (128 to 32, interval 4 to 32, monokernel-backend: amd) and TP4 c4, c8 and c16 (8, 16 and 32 to 1, 2 and 4). Sessions past the cap queue instead of widening the step. TP2 c4, c16 and c32 and TP4 c1 keep their caps from main.
  • Runs TP2 c32 at prefill-decode-interval 32 instead of 8: 209.6 against 197.6 P90 interactivity at the same throughput.
  • Adds TP2 c64, TP2 DPA c128, TP2 DPA EP2 c128, TP4 DPA EP4 c128 and TP4 DPA EP4 c256, and drops TP2 DPA c32: TP2 c32 now serves the same throughput (110,381 against 110,744) at 1.6x its P90 interactivity.
  • Tokenizes every point with --tokenizer-backend fastokens (in main only TP2 c32 used it). The image ships fastokens, and its token ids equal the Hugging Face backend's on 8k to 508k-token inputs and on the chat template. A 195k-token prompt tokenizes in 3 ms instead of 0.37 s on the tokenizer manager's event loop.
  • Serves every point with --image-processor-backend pil. AgentX and GSM8K send text only. With auto, one DP rank builds the V4.1 Rust image processor under a file lock in the shared cache; in 3 of 6 TP2 DPA startups in CI that rank never got the lock and the server failed its health check.

Under DP attention, one rank's prefill stalls every rank's decode. The c128/c256 variants therefore use a longer prefill-decode interval with shortest-prefill-first, SGLANG_DSV41_ENGRAM_HOST_TABLE_LAYOUT=shared, and, with EP, SGLANG_DP_SHARED_EXPERT_LOCAL=1. All changes are SGLang flags and environment variables; there are no source patches.

Variant interval chunked prefill max running other
override_tp2_c128_dp 24 32768 128
override_tp2_c128_dp_ep 32 32768 128 EP2
override_tp4_c128_dp_ep 32 32768 128 EP4
override_tp4_c256_dp_ep 40 65536 256 EP4, cuda-graph-max-bs-decode 128, prefill-delayer low watermark 0.85, swa-prefix-tails 12288

Results from this PR's sweep 44231353783, against main's sweep from #5029 (43344632854). Each cell is P90 interactivity (tok/s/user) / throughput (tok/s/GPU); bold marks points whose settings this PR changes or adds.

pareto_pr5034_main
Point main (#5029) This PR Change (P90 / throughput)
TP4 c1 775.2 / 8,014 763.4 / 8,093 −1.5% / +1.0%
TP4 c2 714.3 / 8,493 709.2 / 8,396 −0.7% / −1.1%
TP4 c4 625.0 / 10,343 763.4 / 10,387 +22.1% / +0.4%
TP4 c8 540.5 / 17,200 617.3 / 17,492 +14.2% / +1.7%
TP4 c16 434.8 / 29,846 476.2 / 29,839 +9.5% / 0.0%
TP2 c1 606.1 / 15,083 591.7 / 15,405 −2.4% / +2.1%
TP2 c2 485.4 / 15,059 495.0 / 15,077 +2.0% / +0.1%
TP2 c4 606.1 / 19,130 602.4 / 19,028 −0.6% / −0.5%
TP2 c8 387.6 / 32,240 450.5 / 32,348 +16.2% / +0.3%
TP2 c16 336.7 / 57,345 334.4 / 57,675 −0.7% / +0.6%
TP2 c32 197.6 / 110,904 209.6 / 110,381 +6.1% / −0.5%
TP2 c64 – 104.2 / 164,369 new
TP2 DPA c32 131.9 / 110,744 – dropped
TP2 DPA c64 73.3 / 181,052 72.3 / 182,846 −1.4% / +1.0%
TP2 DPA c128 – 58.5 / 231,002 new
TP2 DPA EP2 c128 – 64.8 / 207,331 new
TP4 DPA EP4 c128 – 100.7 / 159,880 new
TP4 DPA EP4 c256 – 77.4 / 249,096 new

The changed points gain 6% to 22% P90 interactivity at the same throughput, and the throughput end moves from 181,052 to 249,096 tok/s/GPU (+38%). On the P90 range main covers (73 to 775), the new frontier is higher on 93% of it, by more than 5% on 55% and by more than 20% on 33%. It is more than 2% below main on about 2% of the range, in two stretches at points whose settings this PR does not change: P90 604 to 606 (TP2 c4, 602.4 against 606.1) and P90 764 to 775 (TP4 c1, 763.4 against 775.2, a P90 ITL of 1.31 against 1.29 ms; CI records ITL to 0.01 ms). The unchanged points move by 2.4% or less between the two sweeps.

Risk: the caps trade TTFT for P90 interactivity. In local 3600 s runs, mean TTFT was 6.4 s at TP2 c64 and 3.5 s at TP2 c32; neither scored metric counts it.

Validation details
  • CI: all agentic points and GSM8K eval-only jobs in 44231353783 pass. Four points first landed on mia1-p01-g11 and measured 15% to 22% below their local results (TP2 c32 176.7, TP2 c4 515.5, TP4 c16 371.7, TP4 c4 617.3 P90). Each was rerun as a single job; the table uses every point's latest attempt. TP2 c4, TP4 c16 and TP4 c4 landed on g11 again in the rerun and measured within 1.4% of their local results. Failures in the sweep were host setup timing out while waiting for GPU memory to clear on mia1-p01-g09 and mia1-p01-g15, and were rerun.
  • Local 3600 s runs on MI355X for the changed points, bound by infx.srt_slurm.single_node.select_recipe with golden acceptance 3.51 from build_overrides and measured with python3 -m infx.bench agentic: TP4 c4 774.3 / 10,332, TP4 c8 616.6 / 17,282, TP4 c16 477.3 / 29,875, TP2 c8 456.6 / 32,641, TP2 c32 206.4 / 110,483, TP2 c64 102.1 / 162,080. All runs had 0 failed requests and passed validate_agentic_result.
  • GSM8K on 20261111, eval-only with real DSpark verification, 1319 questions, 5-shot, checked by infx.evals.validate_scores against the 0.90 floor (strict-match / flexible-extract): TP2 c64 0.9765 / 0.9757, TP2 DPA c64 0.9697 / 0.9689, TP2 DPA c128 0.9757 / 0.9750, TP4 DPA EP4 c256 0.9735 / 0.9727.
  • TP4 DPA EP4 c256 with swa-prefix-tails 12288 instead of 4096: 77.4 / 249,096 in CI, against 80.3 / 229,956 in a local run with 4096 tails. With 4096 tails, idle sessions' prefixes were evicted and about 20% of prefill was recompute.
  • Rejected alternatives (local 3600 s): TP2 c16 cap 5 (310.4 / 57,875); TP2 c32 cap 9 (191.0 / 111,160) and cap 10 (176.1 / 111,119); TP2 c64 cap 8 (201.3 / 94,238), cap 16 (139.2 / 125,614) and cap 24 (115.5 / 149,043).
AI model disclosure
PR checklist and change type

Type of Change

  • Bug fix
  • New feature
  • Configuration change
  • Documentation update
  • Other (please describe)

Checklist

  • I have completed the AI model disclosure and kept it current
  • I have tested my changes locally
  • I have updated documentation if necessary
  • If python -m infx.matrix.changed --base origin/main lists affected config keys, I have appended one new entry covering them to the physical end of inferencex-e2e/perf-changelog.yaml; if it lists none, I have added none. I have not edited historical entries
  • If this PR appends an inferencex-e2e/perf-changelog.yaml entry, it carries exactly one primary sweep label (a maintainer applies it on fork PRs): full-sweep-fail-fast (recommended), full-sweep-enabled, or non-canary-full-sweep-enabled. Optional modifiers all-evals, evals-only, and agentx-fast require a primary label; the last two block reuse while applied.
  • Before merging via reuse, a maintainer with write access to the repository has commented /use <run_id> (or the legacy /reuse-sweep-run) on this PR. Do this only once there is a final full sweep that is all green with evals passing, since after this comment the primary sweep label will no longer automatically kick off new sweeps. Remove and re-add the primary sweep label to force a new sweep.
中文

main(#5029)中 dsv41flash-fp4-mi355x-sglang-agentic-dspark 的 MI355X SGLang 前沿,在 TP2 c16 与 TP2 c4 之间、TP2 c4 与 TP4 c1 之间明显下凹,吞吐最高只到 181,052 tok/s/GPU。下凹主要来自调度:AgentX 的会话在两轮之间会空闲,TP2 并发 4 到 32 时平均只有约四分之一的 lane 在 decode,但会突发到一半。max-running-requests 设得高时,每次突发都会撑宽 decode step,拉低 P90 交互性。

本 PR:

  • 限制运行请求数:TP2 c8 从 16 改为 2(prefill-decode-interval 从 192 改为 48),TP2 c64 从 128 改为 32(interval 从 4 改为 32,并使用 monokernel-backend: amd),TP4 c4、c8、c16 从 8、16、32 改为 1、2、4。超出上限的会话排队,不再撑宽 step。TP2 c4、c16、c32 和 TP4 c1 沿用 main 的上限。
  • TP2 c32 的 prefill-decode-interval 从 8 改为 32:吞吐相同,P90 交互性从 197.6 提高到 209.6。
  • 新增 TP2 c64、TP2 DPA c128、TP2 DPA EP2 c128、TP4 DPA EP4 c128 和 TP4 DPA EP4 c256,删除 TP2 DPA c32:TP2 c32 现在吞吐相当(110,381 对 110,744),P90 交互性是它的 1.6 倍。
  • 所有点使用 --tokenizer-backend fastokens(main 中只有 TP2 c32 使用):镜像自带 fastokens,在 8k 到 50.8 万 token 的输入和 chat template 上,它的 token id 与 Hugging Face 后端完全一致。19.5 万 token 的 prompt 分词从 0.37 秒降到 3 毫秒,而且不再占用 tokenizer manager 的事件循环。
  • 所有点使用 --image-processor-backend pil:AgentX 和 GSM8K 只发送文本。默认的 auto 会让一个 DP rank 在共享缓存的文件锁下编译 V4.1 的 Rust 图像处理扩展;CI 中 6 次 TP2 DPA 启动有 3 次该 rank 一直拿不到锁,服务健康检查失败。

DP attention 下,任一 rank 做 prefill 都会阻塞所有 rank 的 decode。因此 c128/c256 变体使用更长的 prefill-decode interval 搭配 shortest-prefill-first、SGLANG_DSV41_ENGRAM_HOST_TABLE_LAYOUT=shared,开启 EP 时再加 SGLANG_DP_SHARED_EXPERT_LOCAL=1。所有改动都只涉及 SGLang 启动参数和环境变量,没有修改源码,各变体参数见上方表格。

结果见上表:本 PR 为 sweep 44231353783,main 为 #5029 的 sweep 43344632854,加粗的是本 PR 修改或新增的点。改动的点在相同吞吐下 P90 交互性提高 6% 到 22%,吞吐上限从 181,052 提高到 249,096 tok/s/GPU(+38%)。在 main 覆盖的 P90 区间(73 到 775)内,新前沿有 93% 高于 main,其中 55% 高出 5% 以上,33% 高出 20% 以上。低于 main 超过 2% 的区间约占 2%,分为两小段,都出在本 PR 没有改动配置的点上:P90 604 到 606(TP2 c4,602.4 对 606.1),以及 P90 764 到 775(TP4 c1,763.4 对 775.2,即 P90 ITL 1.31 对 1.29 毫秒;CI 只记录到 0.01 毫秒)。未改动的点在两次 sweep 之间的差异都在 2.4% 以内。

风险:限流是用 TTFT 换 P90 交互性。本地 3600 秒测试中,TP2 c64 的平均 TTFT 为 6.4 秒,TP2 c32 为 3.5 秒;两个评分指标都不计入 TTFT。

验证:44231353783 中所有 agentic 点和 GSM8K eval-only 作业都已通过。有 4 个点第一次运行时落在 mia1-p01-g11 上,比本地结果低 15% 到 22%,已逐个单独重跑,表中取每个点最新一轮的结果;其中 TP2 c4、TP4 c16、TP4 c4 重跑时仍落在 g11 上,但结果与本地相差都在 1.4% 以内。sweep 中的失败都是 mia1-p01-g09 和 mia1-p01-g15 上等待 GPU 显存清空超时,已重跑。GSM8K(20261111 镜像,真实 DSpark 校验,1319 题,5-shot,门槛 0.90)strict-match / flexible-extract:TP2 c64 0.9765 / 0.9757,TP2 DPA c64 0.9697 / 0.9689,TP2 DPA c128 0.9757 / 0.9750,TP4 DPA EP4 c256 0.9735 / 0.9727。本地结果、被否决的备选参数等详见 Validation details。

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

  • Review: If this PR changes files owned by someone other than a repository admin or @SemiAnalysisAI/core, ask one eligible CODEOWNER to complete the latest PR_REVIEW_CHECKLIST.md before contacting a core maintainer on Slack. Follow the template exactly, including As a PR reviewer and CODEOWNER, I have reviewed this and have, so sign-off verification triggers.
  • PR verification: Sweeps run only when the PR appends an inferencex-e2e/perf-changelog.yaml entry and carries exactly one primary label: full-sweep-fail-fast (strongly recommended; canary plus per-matrix fail-fast), full-sweep-enabled (canary; matrix jobs continue after a failure), or non-canary-full-sweep-enabled (no canary or fail-fast). The modifiers all-evals, evals-only, and agentx-fast require a primary label. On fork PRs, a maintainer applies the label. See sweep labels and reuse.
  • After merging: PR authors must ensure all GitHub Actions jobs pass. Transient failures often pass on rerun; see how to rerun failed jobs.
中文

感谢你的贡献!

  • **审阅:**如果 PR 修改的文件归属于仓库管理员及 @SemiAnalysisAI/core 之外的 CODEOWNER,请先联系一位有资格的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,再通过 Slack 联系核心维护者。必须严格遵循模板,并保留 As a PR reviewer and CODEOWNER, I have reviewed this and have,才能触发签核验证。
  • **PR 验证:**只有当 PR 在 inferencex-e2e/perf-changelog.yaml 末尾追加了条目,并且恰好带有一个主标签时,才会运行扫描:full-sweep-fail-fast(强烈推荐;canary 加逐矩阵 fail-fast)、full-sweep-enabled(有 canary;矩阵任务在失败后继续运行)或 non-canary-full-sweep-enabled(无 canary,也无 fail-fast)。修饰标签 all-evals、evals-only 和 agentx-fast 必须与主标签一起使用。fork PR 的标签由维护者添加。参见扫描标签与复用。
  • **合并后:**PR 作者必须确保所有 GitHub Actions 任务通过。临时性失败通常可以通过重新运行恢复;参见重新运行失败任务的说明。

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Besides the inline nit, I checked whether the binder resolves each of the five new matrix points to exactly one recipe variant. It does. validate_recipe in infx/srt_slurm/single_node.py matches on tp, data-parallel-size, expert-parallel-size, DP attention, gpus and CONC, and these fields tell override_tp2_c128_dp (EP1) apart from override_tp2_c128_dp_ep (EP2). TP2 c64 binds to the existing override_tp2_c64.

Extended reasoning...

The change touches three files: the dsv41flash MI355X SGLang agentic recipe, amd-master.yaml and perf-changelog.yaml, all of them CODEOWNER-owned. The note covers only binder uniqueness. It does not repeat the inline comment-rule nit.

Comment thread inferencex-e2e/configs/amd-master.yaml Outdated
Comment on lines +1135 to +1137
# SGLang ROCm 10 MI35X release image. TP2/EP1 up to c64, TP4/EP1 up to c16,
# DP2 attention with TP MoE from c32 to c128 (c32 and c64 overlap TP2), DP2/EP2 at c128,
# DP4/EP4 at c128 and c256. Host Engram on all.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 nit (optional): Maintainers get two rewritten comments that only describe which TP/DP/EP topology covers which concurrencies, which the repo's comment rule forbids. They restate the search-space rows and the override list, so they go stale whenever a point changes. Fix: drop the topology listings at both sites and keep only short why-comments such as "Host Engram on all" if that needs explaining. Same pattern at 2 sites (configs/amd-master.yaml:1135-1137, srt-slurm-recipes/dsv41flash/sglang/mi355x-fp4-mtp/agentic.yaml:65-66).

Why this was flagged

AGENTS.md:56 says "No header comments describing a file, topology, config, recipe, override, or section". AGENTS.md:58 allows only short technical explanations of why a value was chosen, and never a restatement of the code. The diff rewrites and extends the comment at amd-master.yaml:1135-1137 ("TP2/EP1 up to c64, TP4/EP1 up to c16, DP2 attention with TP MoE from c32 to c128 ..., DP2/EP2 at c128, DP4/EP4 at c128 and c256"). It also extends agentic.yaml:65-66 ("amd-master.yaml runs TP2 through c64, TP4 through c16; DP2 covers c32 to c128, DP2 EP2 c128 and DP4 EP4 c128 and c256"). Both only restate the search-space rows at amd-master.yaml:1151-1155 and the override_* keys. The base had the same kind of comment in shorter form, and this PR had to edit both copies to keep them in sync. Each future point change carries the same maintenance cost and risk of drift.

Verification: AGENTS.md:56 says "No header comments describing a file, topology, config, recipe, override, or section." The diff rewrites inferencex-e2e/configs/amd-master.yaml:1135-1137 so it restates the search-space rows at lines 1151-1155. It also rewrites agentic.yaml:65-66 to describe another file's topology. These comments existed on the base in an older form. Nothing breaks at runtime: the comments only go stale when points change.

@limou102 limou102 added the full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

@limou102 limou102 added full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) and removed full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) labels Nov 12, 2026
…ang-c128-c256

# Conflicts:
#	inferencex-e2e/perf-changelog.yaml
AgentX is text only; the V4.1 Rust image processor's build lock on the shared
cache hung one DP rank at startup in CI.
@chunfangamd chunfangamd removed the full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) label Nov 14, 2026
@chunfangamd chunfangamd added the full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) label Nov 14, 2026
@chunfangamd

Copy link
Copy Markdown
Collaborator

Thanks, @limou102, for the contribution! Please also prepare an SGLang cookbook PR to align it with the recipes you proposed here.
https://github.com/sgl-project/sglang/tree/main/docs/cookbook/autoregressive/DeepSeek

…ang-c128-c256

# Conflicts:
#	inferencex-e2e/perf-changelog.yaml
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

@limou102 staged run 43712971238.

This run remains available across future /stage-results requests. Staging the same run ID again updates its staged data. Staging workflow

# Conflicts:
#	inferencex-e2e/benchmarks/single_node/srt-slurm-recipes/dsv41flash/sglang/mi355x-fp4-mtp/agentic.yaml
#	inferencex-e2e/perf-changelog.yaml
@limou102 limou102 added full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) and removed full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) labels Nov 17, 2026
# Conflicts:
#	inferencex-e2e/perf-changelog.yaml
@limou102 limou102 added full-sweep-enabled Full sweep with canary gate; matrix jobs run to completion despite failures and removed full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) labels Nov 18, 2026
@limou102 limou102 changed the title [AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang: bump image to 20261111 and add DP attention c128/c256 points / [AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang:升级镜像至 20261111 并新增 DP attention c128/c256 配置点 [AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang: cap running requests, fastokens tokenizer, and DP attention c128/c256 points / [AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang:限制运行请求数、使用 fastokens 分词并新增 DP attention c128/c256 配置点 Nov 19, 2026
@limou102

Copy link
Copy Markdown
Collaborator Author

/use 44231353783

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

@limou102 staged run 44231353783.

This run remains available across future /stage-results requests. Staging the same run ID again updates its staged data. Staging workflow

@limou102

Copy link
Copy Markdown
Collaborator Author

@SemiAnalysisAI SemiAnalysisAI deleted a comment from limou102 Nov 20, 2026
@chunfangamd

Copy link
Copy Markdown
Collaborator
image

@chunfangamd

Copy link
Copy Markdown
Collaborator

@limou102 SGLang #50677 is merged, but the cookbook still reflects an earlier configuration and does not fully match this PR’s final serving settings. Please verify and align all production-useful flags, environment variables, and worker/router commands, then merge the cookbook update before this PR merges.

@chunfangamd

chunfangamd commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Hi @functionstackx , the current PR inherits base.roles.agg.args.enforce-shared-experts-fusion: true from the existing base recipe. In the pinned SGLang image, this requantizes DSpark’s native FP8 shared-expert weights to MXFP4 on affected EP1 paths. This includes the newly added TP2 DPA c128 configuration.
Do you have guidance on this?

While waiting for feedback from @functionstackx, @limou102, could you please follow the instructions here #4705 and try to provide solid evidence from your side to unblock the potential precision-sensitive concerns. Thanks!

@limou102

Copy link
Copy Markdown
Collaborator Author

@chunfangamd @functionstackx Thanks for the review. Some context on the shared-expert quantization:

The SGLang cookbook has been updated to match this PR's final serving settings in sgl-project/sglang#52053: running-request caps, prefill-decode intervals, the new TP2 c64 point, --tokenizer-backend fastokens and --image-processor-backend pil on every point, and 12288 SWA prefix tails for DP4 + EP4 c256. I will post an update here once it merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-sweep-enabled Full sweep with canary gate; matrix jobs run to completion despite failures

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants